<template>
<div class="app-container">
  <!-- 头部 -->
<mt-header fixed title="状元坊" class="bgc">
	<div @click="last" slot="left" v-show="flag">
    		<mt-button icon="back">返回</mt-button>
        </div>
</mt-header>
 
 <!-- 身体 -->
 <transition>
			<router-view></router-view>
	</transition>

<!-- 底部 -->

		<nav class="mui-bar mui-bar-tab">
			<router-link class="mui-tab-item-cyt" to="/home">
				<span class="mui-icon mui-icon-home"></span>
				<span class="mui-tab-label">首页</span>
			</router-link>
			<router-link class="mui-tab-item-cyt" to="/news">
				<span class="mui-icon mui-icon-email"><span class="mui-badge" id="badge">9</span></span>
				<span class="mui-tab-label">信息</span>
			</router-link>
			<router-link class="mui-tab-item-cyt" to="/Me">
				<span class="mui-icon mui-icon-contact">
					</span> <!--{{$store.getters.getAllCount}} -->
				<span class="mui-tab-label">我的</span>
			</router-link>
		</nav>

</div>
</template>

<script>
//import mui from './lib/mui/js/mui.min.js'

export default {
	data(){
		return {
			flag:false
		}
	},
	created() {
		this.flag = this.$router.path === '/home'? false: true;
	},
	modules() {
		// this.$route.params.year
	
	},
	methods:{
		last(){
			// console.log(this) 
			// console.log(this.$route.params.year)
			this.$router.go(-1)       //返回上一步的功能实现
		},
		
	},
	watch:{
		'$route.path':function (newVal) { 
			if(newVal === "/home"){
				this.flag = false
			}else{
				this.flag = true
			}
		 }
		
	}
}
	 


</script>


<style lang="scss" scoped>
// html{
// 	background-color: #F2F2F2;
// }
// * { touch-action: none; } 
.mint-header {
		z-index: 99;
}
.bgc{
		background-color: #06C1AE;
}
.app-container{
		padding-top: 40px;
		overflow-x: hidden;
		padding-bottom: 50px;
	}
	.v-enter{
		opacity: 0;
		transform: translateX(100%);
	}
	.v-leave-to{
		opacity: 0;
		transform: translateX(-100%);
		position: absolute;
	}
	.v-enter-active,
	.v-leave-active{
		transition: all 0.5s ease;
	}

	//mui-ui 自身的问题，导致类名冲突，要自定义类，tabber 才能生效
	.mui-bar-tab .mui-tab-item-cyt.mui-active {
    color: #007aff;
	}
	.mui-bar-tab .mui-tab-item-cyt {
    display: table-cell;
    overflow: hidden;
    width: 1%;
    height: 50px;
    text-align: center;
    vertical-align: middle;
    white-space: nowrap;
    text-overflow: ellipsis;
    color: #929292;
  }
	.mui-bar-tab .mui-tab-item-cyt .mui-icon {
    top: 3px;
    width: 24px;
    height: 24px;
    padding-top: 0;
    padding-bottom: 0;
  }
	.mui-bar-tab .mui-tab-item-cyt .mui-icon~.mui-tab-label {
    font-size: 11px;
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
}
</style>
